class Initial < ActiveRecord::Migration
  def self.up
    create_table :users do |t|
      t.string      :name
      t.string      :login      
      t.string      :email
      t.integer     :ruby_skill
      t.integer     :python_skill
      t.string      :gmt
      t.string      :city
      t.text        :comments
      t.string      :secret_url
      t.string      :type
      
      t.string      :password, :limit => 40
      
      t.timestamps
    end
    
    create_table :groups do |t|
      t.integer     :creator_id
      t.string      :jabber_room
      t.timestamps
    end
    
    create_table :conquests do |t|
      t.datetime   :start_time
      t.datetime   :end_time
      t.string     :name
      t.text       :description
      t.timestamps
    end
    
    create_table :participations do |t|
      t.integer     :user_id
      t.integer     :group_id
      t.timestamps
    end
    
    create_table :projects do |t|
      t.integer     :gtoup_id
      t.integer     :creator_id
      t.string      :type
      t.text        :svn_repository_path
      t.timestamps
    end

    create_table :requests do |t|
      t.integer     :user_id
      t.integer     :group_id      
      t.text        :message
      t.timestamps
    end
  end

  def self.down
    drop_table :users
    drop_table :groups
    drop_table :conquests
    drop_table :participations
    drop_table :projects
    drop_table :requests
  end
end
